package com.floreo.shopping.service.impl;

import com.floreo.shopping.model.Group;
import com.floreo.shopping.model.Product;
import com.floreo.shopping.service.IProductService;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 */
public class ProductService implements IProductService {
    private Map<String, Product> products = new HashMap<String, Product>();

    @Override
    public Product getProductByName(String name) {
        return products.get(name);
    }

    @Override
    public void registerProduct(Product product) {
        products.put(product.getName(), product);
    }

    @Override
    public void removeProduct(Product product) {
        products.remove(product);
    }
}
